package com.ruoyi.merchant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 业务类型枚举
 */
@Getter
@AllArgsConstructor
public enum BusinessTypeEnum {
    
    ORDER_INCOME(1, "订单收入"),
    REFUND_EXPENSE(2, "退款支出"),
    WITHDRAW(3, "提现"),
    PLATFORM_FEE(4, "平台服务费"),
    MARKETING_FEE(5, "营销费用"),
    FINE(6, "罚款"),
    DEPOSIT(7, "保证金"),
    OTHER(8, "其他");
    
    private final Integer code;
    private final String desc;
    
    public static String getDescByCode(Integer code) {
        if (code == null) {
            return "";
        }
        for (BusinessTypeEnum type : values()) {
            if (type.getCode().equals(code)) {
                return type.getDesc();
            }
        }
        return "";
    }
}
